<div>
<!-- TODO Consolidate in partial -->
<!--Sorts pages by the publishdate field in front matter; you could use by date as well; the reverse puts the newest at the front-->
{{$posts := ($.Site.GetPage "section" "posts").Pages.ByPublishDate.Reverse}}
<!--Grab the most recent-->
{{ range first 1 $posts }}
<p><a href="{{ .Permalink }}">{{ .Title }}</a> <-- Latest</p>
{{ end }}

{{ with .NextInSection }}
<p><a href="{{ .Permalink }}">{{ .Title }}</a> <-- Next</p>
{{ end }}

{{ with .PrevInSection }}
<p><a href="{{ .Permalink }}">{{ .Title }}</a> <-- Previous</p>
{{ end }}

{{ range first 1 (shuffle $posts)  }}
<p><a href="{{ .Permalink }}">{{ .Title }}</a> <-- Random</p>
{{ end }}
</div>
